#! /usr/bin/python

import math
import time

now = time.time()

def multiplicity(n, p):
    if p > n: return 0
    if p > n//2: return 1
    q, m = n, 0
    while q >= p:
        q //= p
        m += q
    return m

def primes(n):
    n = n + 1
    sieve = range(n)
    sieve[:2] = [0, 0]
    for i in xrange(2, int(n**0.5)+1):
        if sieve[i]:
            for j in xrange(i**2, n, i):
                sieve[j] = 0
    # Filter out the composites, which have been replaced by 0's
    return [p for p in sieve if p]

allp = primes(20*10**6)
power5 = []
power15 = []
power20 = []
for p in allp:
    power5.append(multiplicity(5*10**6, p))

for p in allp:
    power15.append(multiplicity(15*10**6, p))

for p in allp:
    power20.append(multiplicity(20*10**6, p))

ss = 0
for i in range(len(allp)):
    ss += (power20[i] - power5[i] - power15[i])*allp[i]
    #print primes[i] 


print ss
#print alln[100:200]
#print bottom[100:200]    
#print bottom.count(1)

print time.time() - now
	   
    
